Skip to content

server: fix resource count error when upgrade a vm#3759

Merged
DaanHoogland merged 1 commit into
apache:4.13from
ustcweizhou:4.13-fix-resource-count-upgrade-vm
Jan 23, 2020
Merged

server: fix resource count error when upgrade a vm#3759
DaanHoogland merged 1 commit into
apache:4.13from
ustcweizhou:4.13-fix-resource-count-upgrade-vm

Conversation

@ustcweizhou
Copy link
Copy Markdown
Contributor

Description

Steps to reproduce the issue
(1) create an account (test)
(2) create a vm with the account (test)
(3) login with admin, and upgrade the vm to another offering
(4) the resource count (cpu,memory) of admin increases, not the account (test).

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Screenshots (if appropriate):

How Has This Been Tested?

Steps to reproduce the issue
(1) create an account (test)
(2) create a vm with the account (test)
(3) login with admin, and upgrade the vm to another offering
(4) the resource count (cpu,memory) of admin increases, not the account (test).
Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes a lot of sense. code looks good

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-639

@DennisKonrad
Copy link
Copy Markdown
Contributor

@ustcweizhou I tried to recreate the bug with current master in a testenvironment. Are the any Domains, Projects or something else involved?

Just creating another user with an vm and increasing the VM ressources with admin did not show the bug.
I checked the resourcecount via api with
update resourcecount domainid=xxxxx account=testuser
and it showed the right counts.

If I can recreate the bug I can review your PR.

@DennisKonrad DennisKonrad self-requested a review January 22, 2020 15:09
@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-808)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 30995 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3759-t808-kvm-centos7.zip
Smoke tests completed. 77 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@weizhouapache
Copy link
Copy Markdown
Member

@ustcweizhou I tried to recreate the bug with current master in a testenvironment. Are the any Domains, Projects or something else involved?

Just creating another user with an vm and increasing the VM ressources with admin did not show the bug.
I checked the resourcecount via api with
update resourcecount domainid=xxxxx account=testuser
and it showed the right counts.

If I can recreate the bug I can review your PR.

@DennisKonrad thanks for testing.
update resource count will recalculate the resource count and update database if count is not same so the value in response is always correct.

However the count is not correct if we use listDomains or listAccounts before updateresourcecount.

@DaanHoogland
Copy link
Copy Markdown
Contributor

thanks @DennisKonrad , can you review,test and/or confirm that this fixes the bug or at least is an improvement? (this need a second 👍 )

@DennisKonrad
Copy link
Copy Markdown
Contributor

@ustcweizhou @DaanHoogland I was able to reproduce the bug (on current master) and this PR fixes the issue. So LGTM

@DaanHoogland DaanHoogland merged commit b79a539 into apache:4.13 Jan 23, 2020
DaanHoogland added a commit that referenced this pull request Jan 23, 2020
* 4.13:
  fixed inconsistency of IP on VR when VR is destroyed and recrea… (#3825)
  server: fix resource count error when upgrade a vm (#3759)
ustcweizhou added a commit to ustcweizhou/cloudstack that referenced this pull request Feb 28, 2020
Steps to reproduce the issue
(1) create an account (test)
(2) create a vm with the account (test)
(3) login with admin, and upgrade the vm to another offering
(4) the resource count (cpu,memory) of admin increases, not the account (test).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants